﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Tong;
public partial class Admin_menu : System.Web.UI.UserControl
{
    public TongUse TextData = new TongUse();
    public string Abs_path = TongUse.SysPath;
    protected void Page_Load(object sender, EventArgs e)
    {
        CopyRight.Text = TongUse.CopyRight.ToString();//程序編寫資訊
        CopyRight2.Text = TongUse.COPY.ToString();//得到版权
        CopyRight1.Text = TongUse.CopyRight_jieM.ToString();//得到介面設計資訊
        try
        {
            
            if (Request.Cookies["admin"].Value != "")
            {
                XmlData.DataFile = Abs_path + "aspnet/admin/Menu/Menu_Data/" + Request.Cookies["admin"].Value + ".xml";
            }
            else
            {
                //没有初始化处理
                XmlData.DataFile = "../Menu/Menu_Data/error.xml";
            }
        }
        catch (Exception ex)
        {
            //没有初始化处理
            XmlData.DataFile = "../Menu/Menu_Data/error.xml";
        }
    }

    /// <summary>
    /// 退出
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void loginout_Click(object sender, EventArgs e)
    {
        Response.Cookies["admin"].Value = "";
        Response.Write("<script>window.parent.location.href=\"../../\";</script>");

    }
}
